package cn.com.oil.common.model;

import lombok.Getter;
import lombok.Setter;

import java.util.ArrayList;
import java.util.List;

public class FileSystemNode {

    @Getter
    @Setter
    private String name;
    private Boolean isDirectory;
    @Getter
    @Setter
    private FileSystemNode parent;
    @Setter
    @Getter
    private List<FileSystemNode> children;


    public Boolean getDirectory() {
        return isDirectory;
    }

    public void setDirectory(Boolean directory) {
        isDirectory = directory;
    }

    public FileSystemNode(String name, Boolean isDirectory, FileSystemNode parent) {
        this.name = name;
        this.isDirectory = isDirectory;
        this.parent = parent;
        this.children = new ArrayList<>();
    }


    public void addChild(FileSystemNode child) {
        children.add(child);
    }


}


